From: Ayan Kumar Halder Date: Tue, 7 Feb 2023 16:00:47 +0000 (+0100) Subject: ns16550: fix an incorrect assignment to uart->io_size X-Git-Tag: archive/raspbian/4.17.1+2-gb773c48e36-1+rpi1~1^2~36^2~14 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d0127881376baeea1e4eb71d0f7b56d942147124;p=xen.git ns16550: fix an incorrect assignment to uart->io_size uart->io_size represents the size in bytes. Thus, when serial_port.bit_width is assigned to it, it should be converted to size in bytes. Fixes: 17b516196c ("ns16550: add ACPI support for ARM only") Reported-by: Jan Beulich Signed-off-by: Ayan Kumar Halder Reviewed-by: Stefano Stabellini master commit: 352c89f72ddb67b8d9d4e492203f8c77f85c8df1 master date: 2023-01-24 16:54:38 +0100 --- diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c index 01a05c9aa8..ce013fb6a5 100644 --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -1875,7 +1875,7 @@ static int __init ns16550_acpi_uart_init(const void *data) uart->parity = spcr->parity; uart->stop_bits = spcr->stop_bits; uart->io_base = spcr->serial_port.address; - uart->io_size = spcr->serial_port.bit_width; + uart->io_size = DIV_ROUND_UP(spcr->serial_port.bit_width, BITS_PER_BYTE); uart->reg_shift = spcr->serial_port.bit_offset; uart->reg_width = spcr->serial_port.access_width;